package com.atguigu.spbt.test1214.mapper;

import com.atguigu.spbt.test1214.bean.Customer;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CustomerMapper {

    // select * from customer
    @Select("select * from customer")
    public List<Customer> getCustomerList();

    @Select("select * from customer  where id=#{id}")
    public Customer getCustomerById(String id );


    @Insert("insert into customer values(null, #{customer.address},#{customer.age},#{customer.gender})  ")
    public void insertCustomer (@Param("customer") Customer customer );


    @Insert("update  customer set address= #{customer.address}, age=#{customer.age}, gender = #{customer.gender}  where id=#{id}")
    public void updateCustomer (@Param("customer")Customer customer );


    @Insert("delete customer where id=#{id}")
    public void deleteCustomerById (String id  );

}
